package com.lu.bean;

import com.alibaba.fastjson.JSON;
import com.lu.constant.ErrorEnum;
import lombok.Data;
import lombok.ToString;

/**
* @description
* @author luke
* @date 2021/7/13 9:26
*/
@ToString
@Data
public class ResBean {
    /**响应码*/
    private String resCode;
    /**响应信息*/
    private String resMsg;
    /**响应数据*/
    private Object data;

    public ResBean() {
        this.resCode = ErrorEnum.SUCCESS.code;
        this.resMsg = ErrorEnum.SUCCESS.desc;
    }
    public ResBean(String resCode, String resMsg) {
        this.resCode = resCode;
        this.resMsg = resMsg;
    }
    public ResBean(AppException e) {
        this.resCode = e.getErrorCode();
        this.resMsg = e.getErrorMsg();
    }
    public void setByAppException(AppException e){
        this.resCode = e.getErrorCode();
        this.resMsg = e.getErrorMsg();
    }

}
